﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import reprise.ui.*;
    import flash.display.*;
    import reprise.controls.*;
    import net.wooga.pets.views.components.tutorial.*;
    import net.wooga.pets.utils.*;

    public class TutorialOverlay extends UIComponent {

        private var _background:UIComponent;
        private var _focusArrow:UIComponent;
        private var _clickCatcher:UIComponent;
        private var _clickMaskContainer:UIComponent;
        private var _focusRoom:UIComponent;
        private var _focusRoomLabel:Label;
        private var _spotlight:MovieClip;
        private var _spotlightContainer:UIComponent;
        private var _firstPetContainer:UIComponent;
        private var _firstPetComponent:FirstPetComponent;

        public function showFocusArrow(_arg1:int, _arg2:int, _arg3:Number=0):void{
            this._focusArrow.left = _arg1;
            this._focusArrow.top = _arg2;
            this._focusArrow.rotation = _arg3;
            this._focusArrow.show();
            this._spotlight.alpha = 0.6;
        }
        public function hideFocusArrow():void{
            this._focusArrow.hide();
        }
        public function showClickBlocker(_arg1:int=-100, _arg2:int=-100, _arg3:Number=1, _arg4:Boolean=false):void{
            if (_arg4){
                this._clickMaskContainer.addCSSClass("rect");
            } else {
                this._clickMaskContainer.removeCSSClass("rect");
            };
            this._clickMaskContainer.setStyle("left", ("" + (_arg1 - (1000 * _arg3))));
            this._clickMaskContainer.setStyle("top", ("" + (_arg2 - (1000 * _arg3))));
            this._clickMaskContainer.setStyle("transform", (("scale(" + _arg3) + ")"));
            this._clickCatcher.addCSSClass("show");
        }
        public function hideClickCatcher():void{
            this._clickCatcher.removeCSSClass("show");
        }
        public function showSpotlight(_arg1:int=-100, _arg2:int=-100, _arg3:Number=1):void{
            this._spotlight.x = (_arg1 - (1000 * _arg3));
            this._spotlight.y = (_arg2 - (1000 * _arg3));
            this._spotlight.scaleX = (this._spotlight.scaleY = _arg3);
            this._spotlight.visible = true;
        }
        public function showBlockingSpotlight(_arg1:int=-100, _arg2:int=-100, _arg3:Number=1, _arg4:Boolean=false):void{
            this.showSpotlight(_arg1, _arg2, _arg3);
            this.showClickBlocker(_arg1, _arg2, _arg3, _arg4);
        }
        public function hideSpotlight():void{
            this._spotlight.visible = false;
        }
        public function get firstPetComponent():FirstPetComponent{
            return ((this._firstPetComponent = ((this._firstPetComponent) || (this.createPetComponent()))));
        }
        private function createPetComponent():FirstPetComponent{
            this._firstPetComponent = new FirstPetComponent();
            this._firstPetComponent.x = 190;
            this._firstPetComponent.y = -20;
            return (this._firstPetComponent);
        }
        public function hidePetComponent():void{
            if (this._firstPetComponent){
                this._firstPetContainer.removeChild(this._firstPetComponent);
                this._firstPetComponent = null;
            };
        }
        public function showPetComponent():void{
            this._firstPetContainer.addChild(this.firstPetComponent);
        }
        override protected function initialize():void{
            cssID = "tutorialOverlay";
            super.initialize();
        }
        override protected function createChildren():void{
            addCSSClass("myriadProFont");
            this._spotlightContainer = addComponent("spotlight");
            this._spotlightContainer.mouseEnabled = false;
            this._spotlightContainer.mouseChildren = false;
            this._spotlight = AssetsLibrary.getMovieClip("ClickCatcherMask");
            this._spotlight.visible = false;
            this._spotlight.alpha = 0.6;
            this._spotlightContainer.addChild(this._spotlight);
            this._spotlight.mouseEnabled = false;
            this._spotlight.mouseChildren = false;
            this._background = addComponent("layer");
            this._focusArrow = addComponent("focusArrow");
            this._focusArrow.hide();
            this._focusRoom = addComponent("focusRoom");
            this._focusRoomLabel = Label(this._focusRoom.addComponent("focusRoomLabel", null, Label));
            this._clickCatcher = addComponent("clickCatcher");
            this._clickMaskContainer = addComponent("clickCatcherMask");
            this._clickCatcher.mask = this._clickMaskContainer;
            this._firstPetContainer = addComponent("firstPetContainer");
        }

    }
}//package net.wooga.pets.views.components 
